<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // new Promise((resolve, reject) => {
    //   resolve('成功')
    // }).then(
    //   value => console.log(value)
    // )

    function request() {
      return new Promise((resolve, reject) => {
        // resolve('成功')
        setTimeout(() => {
          resolve('成功')
        }, 2000)
      })
    }

    request().then(value => console.log(value))
  </script>
</body>
</html>